package com.freewater.cargotracker.infrastructure.persistence.mybatis.mapper;

import com.freewater.cargotracker.infrastructure.persistence.mybatis.dbobject.CargoPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Set;

@Mapper
public interface CargoMapper {

    int insert(CargoPO cargoPO);

    int update(CargoPO cargoPO);

    int updateByIdSelective(@Param("cargoPO") CargoPO cargoPO,
                            @Param("changedFields") Set<String> changedFields);

    CargoPO findById(Long id);

    CargoPO findByTrackingId(String trackingId);

    int deleteAll();
}
